agents.anac.y2011.TheNegotiator
Class UTBid

java.lang.Object
  extended by agents.anac.y2011.TheNegotiator.UTBid
All Implemented Interfaces:
java.lang.Comparable<UTBid>

public class UTBid
extends java.lang.Object
implements java.lang.Comparable<UTBid>

The UTBid class is used to store a bid with it's corresponding utility. In this way constant recomputation of the utility values is avoided.

Author:
Alex Dirkzwager, Mark Hendrikx, Julian de Ruiter

Constructor Summary
UTBid(Bid bid, double utility)
          Creates a UTBid-object which stores a bid with it's corresponding utility.
 
Method Summary
 int compareTo(UTBid utbid)
          compareTo is used to compare UTbids.
 boolean getAlreadyOffered()
          checks whether the bid has already been made
 Bid getBid()
          Method which returns the bid.
 double getUtility()
          Method which returns the utility.
 void setAlreadyOffered(boolean offered)
          sets the the bid as offered or not
 void setBid(Bid bid)
          Method which sets the bid.
 void setUtility(double utility)
          Method which sets the utility.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UTBid

public UTBid(Bid bid,
             double utility)
Creates a UTBid-object which stores a bid with it's corresponding utility.

Parameters:
bid - of an agent
utility - of the bid
Method Detail

getBid

public Bid getBid()
Method which returns the bid.

Returns:
bid

setBid

public void setBid(Bid bid)
Method which sets the bid.

Parameters:
bid -

getUtility

public double getUtility()
Method which returns the utility.

Returns:
utility

setUtility

public void setUtility(double utility)
Method which sets the utility.

Parameters:
utility -

getAlreadyOffered

public boolean getAlreadyOffered()
checks whether the bid has already been made

Returns:
boolean

setAlreadyOffered

public void setAlreadyOffered(boolean offered)
sets the the bid as offered or not

Parameters:
offered -

compareTo

public int compareTo(UTBid utbid)
compareTo is used to compare UTbids. The comparision is made in such a way that the result is in reverse natural order.

Specified by:
compareTo in interface java.lang.Comparable<UTBid>
Parameters:
another - utbid